<?php

/**
 * This is the model metadata class for table "provider".
 */
class ProviderMetadata extends CARMDC
{
	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'provider';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('category_id, name, address, tel', 'required'),
			array('category_id', 'numerical', 'integerOnly'=>true),
			array('worker_id, name', 'length', 'max'=>20),
			array('address, tel, fax, email, business_license', 'length', 'max'=>255),
			array('legal_representative', 'length', 'max'=>10),
			array('register_code', 'length', 'max'=>100),
			array('desc', 'safe'),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('id, worker_id, category_id, name, address, tel, fax, email, legal_representative, register_code, business_license, desc', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'id' => '企业id',
			'worker_id' => '帐户id',
			'category_id' => '代理分类',
			'name' => '公司名称',
			'address' => '公司详细地址',
			'tel' => '公司电话',
			'fax' => '公司传真',
			'email' => '公司邮箱',
			'legal_representative' => '法人代表',
			'register_code' => '工商注册码',
			'business_license' => '营业执照',
			'desc' => '公司简介',
		);
	}
}